package com.itheima.pattern.factory.factory_static;

public class SimpleCoffeeFactory {

    public static Coffee createcoffee(String coffeeType) {
        Coffee coffee = null;
        if ("american coffee".equals(coffeeType)) {
            coffee = new AmericanCoffee();
        }else if ("latte coffee".equals(coffeeType)) {
            coffee = new LatteCoffee();
        }else {
            throw new RuntimeException("Unknown coffee type: " + coffeeType);
        }
        return coffee;
    }
}
